#include "renamedialog.h"

ReNameDialog::ReNameDialog(QWidget *parent)
	: QDialog(parent)
	, ui(new Ui::ReNameDialogClass())
{
	ui->setupUi(this);

	connect(ui->okBtn, &QPushButton::clicked, this, &ReNameDialog::onOkBtnClicked);
	connect(ui->cancelBtn, &QPushButton::clicked, this, &ReNameDialog::onCancelBtnClicked);
}

void ReNameDialog::onOkBtnClicked() {
	this->accept();
}

void ReNameDialog::onCancelBtnClicked() {
	this->reject();
}

void ReNameDialog::setOldName(const QString& oldName)
{
	ui->newNameLineEdit->setText(oldName);
}

QString ReNameDialog::getNewName()
{
	return ui->newNameLineEdit->text();
}

ReNameDialog::~ReNameDialog()
{
	delete ui;
}
